<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
</head>

<body>
    <div id='div1'>
        <p class='p1'>p1111</p>
        <p class='p1'>p1111</p>
    </div>
    <div id='div2'>
        <p class='p2'>p2222</p>
    </div>
    <script>
        let div1 = document.getElementById('div1');
        console.log(div1.parentElement.parentElement.parentElement)
        let p2 = document.querySelectorAll('p')[1];
        div1.appendChild(p2);
    </script>
</body>

</html>